package com.znh.common;

import com.znh.entity.Piece;

import java.awt.*;
import java.io.Serializable;
import java.util.Comparator;

/**
 * @version 1.0
 * @Author znh
 * @Date 2024/5/30 下午3:41
 * @注释 PointPieceMap的比较器
 */
public class PointPieceMapComparator implements Comparator<Point>, Serializable {
    @Override
    public int compare(Point o1, Point o2) {
        if (o1.x > o2.x) return 1;
        else if (o1.x < o2.x) return -1;
        else if (o1.y > o2.y) return 1;
        else if (o1.y < o2.y) return -1;
        else return 0;
    }
}
